package 多线程.创建多线程.继承Thread;

class Tor extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("乌龟跑了" + i + "步");
        }
    }
}

public class Rabbit extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println("兔子跑了" + i + "步");
        }
    }

    public static void main(String[] args) {
        Rabbit rabbit = new Rabbit();

        Tor tor = new Tor();
        rabbit.start();
        tor.start();

        for (int i = 0; i < 100; i++) {
            System.out.println("main跑了" + i + "步");
        }
    }
}

